package StudyCode.summary.zipfile;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class CopyingAnInputStreamToFile {
	public static void main(String[] args) {
		Path newFile = FileSystems.getDefault().getPath("E:/Copy/3.txt");
		try (InputStream inputStream = new FileInputStream("E:/Copy/2.txt")) {
			Files.copy(inputStream, newFile);
			System.out.println("复制成功!");
		} catch (IOException ex) {
			ex.printStackTrace();
		}

	}
}
